export const mixin={
	methods:{
		
		//只能在onReady中
		getHeight(...domClasses){
			return new Promise((resolve)=>{
				let totalHeight =0;
				const queryPromises=domClasses.map((domClass)=>{
					return new Promise((innerResolve)=>{
					    let view = uni.createSelectorQuery().select(`.${domClass}`);
					    view.boundingClientRect((data)=>{
						//console.log(domClass)
						  if(data&& data.height){
							  totalHeight += data.height;
						  }
						  //	console.log(totalHeight)
						  innerResolve();
					    }).exec();
					});
				});
				Promise.all(queryPromises).then(()=>{
					uni.getSystemInfo({
						success(res){
							const height = res.windowHeight-totalHeight;
							resolve(height)
						}
					});
				});
			});
		},
		
		// stopType: {
		// 	"0": "进行中",
		// 	"1": "远程停止",
		// 	"2": "刷卡停止",
		// 	"3": "预约时间到",
		// 	"4": "充满停止",
		// 	"5": "故障停止",
		// 	"6": "断电停止",
		// 	"7": "急停停止",
		// 	"9": "待结算",
		// 	"8": "余额不足",
		// 	"10": "人工结算",
		// 	"11": "强制解锁",
		// 	"12": "BMS主动停止",
		// 	"16": "共享结束时间到",
		// 	"17": "蓝牙停止",
		// 	"85": "启动失败",
		// 	"255": "拔枪停止"
		// },
courseType(courseLevel){
			let value='';
			switch(courseLevel){
				case 1:
				value="初级";
				break;
				case 2:
				value="中级";
				break;
				case 3:
				value="高级";
				break;
				
			}
			return value;
		},
		
	



	}
}